package com.lizx.persional.common.config;

import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;

import java.sql.Timestamp;

/**
 * @Author 江苏博沣
 * @Description
 * @Date Create in 2018/1/4 15:11
 */

public class MyMetaObjectHandler extends MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        Timestamp time = new Timestamp(System.currentTimeMillis());
        setFieldValByName("gmtCreate", time, metaObject);
        setFieldValByName("gmtModify", time, metaObject);
//        setFieldValByName("enable", true, metaObject);
        setFieldValByName("deleted", false, metaObject);
//        setFieldValByName("version", 0L, metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
    }
}
